minios: clear the event before calling the handler since (especially
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 8 May 2008 10:53:39 +0000 (11:53 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 8 May 2008 10:53:39 +0000 (11:53 +0100)
in the SMP case) the handler may make another domain send an event
again, and that must not be lost.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
extras/mini-os/events.c

index 51a3cc24f04b5050167a572a15b1aba8a1110d8a..f47fc388223f88ad2f7d1362e0a385547aeefe27 100644 (file)
@@ -58,9 +58,12 @@ void unbind_all_ports(void)
 int do_event(evtchn_port_t port, struct pt_regs *regs)
 {
     ev_action_t  *action;
+
+    clear_evtchn(port);
+
     if (port >= NR_EVS) {
         printk("Port number too large: %d\n", port);
-               goto out;
+        return 1;
     }
 
     action = &ev_actions[port];
@@ -69,9 +72,6 @@ int do_event(evtchn_port_t port, struct pt_regs *regs)
     /* call the handler */
        action->handler(port, regs, action->data);
 
- out:
-       clear_evtchn(port);
-
     return 1;
 
 }